package com.beilang.hotline.email.dao;

import java.util.List;

import com.beilang.base.core.dao.BaseDAO;
import com.beilang.hotline.email.model.EmailServerModel;

public class EmailServerDAO extends BaseDAO{
	public EmailServerModel createEmailServer(EmailServerModel emailServerModel) {
		return (EmailServerModel)this.save(emailServerModel);
	}
	
	public EmailServerModel saveEmailServer(EmailServerModel emailServerModel) {
		return (EmailServerModel)this.save(emailServerModel);
	}
	
	public void deleteEmailServer(Long emailServerId){
		this.remove(EmailServerModel.class, emailServerId);
	}
	
	public EmailServerModel getEmailServer(){
		List list=this.getAll(EmailServerModel.class);
		if(list!=null&&list.size()>0)return (EmailServerModel)list.get(0);
		return new EmailServerModel();
	}
}